home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / os2 / te2_120.zip / SCRIPT.DOC < prev    next >
Text File  |  1992-06-15  |  105KB  |  2,371 lines

  1.                                       TE/2 Script Language Reference
  2.  
  3.                                                      Oberon Software
  4.                                                518 Blue Earth Street
  5.                                               Mankato, MN 56001-2142
  6.  
  7.                                         Last Revision: June 15, 1992
  8.  
  9.  
  10.   -------------------------------------------------------------
  11.  
  12. Copyright 1990-92, Oberon Software, Mankato, MN - All Rights Reserved
  13.  
  14.   -------------------------------------------------------------
  15.  
  16.  
  17.  
  18.      ----------------------------------------------------
  19.  
  20. Notice:  Information in this document is subject to change without
  21. notice and does not constitute a commitment on the part of Oberon
  22. Software.
  23.  
  24.      ----------------------------------------------------
  25.  
  26.  
  27. General:
  28. ========
  29.  
  30.   A TE/2 script file is a flat ASCII file containing TE/2 script
  31. commands.  Each line in the file must be terminated with either a
  32. carriage return-line feed pair or with a single line feed.  No line
  33. may be longer than 256 characters in length, a line longer than 256
  34. characters will generate an error message and terminate execution of
  35. the script.
  36.  
  37.   The TE/2 script language is not case sensitive, identifiers,
  38. keywords, functions, et al may be entered in either upper or lower
  39. case in any mixture.  Identifier names (variables, subroutine names)
  40. have no formal length restriction except as relates to the line
  41. length restriction given above.
  42.  
  43.   Blank lines within the script file are ignored as are any leading
  44. or trailing space or tab characters on a line.  You may indent and
  45. space the file any way you please for readability purposes.  The
  46. semicolon is the comment mark character.  Any and all text on a line
  47. including and following a semicolon (;) is ignored.  The obvious
  48. exception to this is when the semicolon appears within a quoted
  49. string.
  50.  
  51.  
  52.  
  53. REXX/2 Language Scripts
  54. =======================
  55.  
  56. In addition to the script language syntax described in this document,
  57. you may also create your scripts using the REXX Procedure Language.
  58. You must be operating under a version of OS/2 which supports REXX to
  59. use this feature.  Because TE/2 sets itself up as the default addresssing
  60. environment when it executes a REXX procedure, all of the functions
  61. described later in this document are available also to the REXX
  62. script as are most of the TE/2 built-in and system variables.  You are
  63. referred to the section of this document titled "Notes on REXX Scripts"
  64. for further information.
  65.  
  66.  
  67.  
  68. Executing a script:
  69. ===================
  70.  
  71.   A script file may be executed in one of four ways:
  72.  
  73.     1) Type Alt-/ (Alt-Slash) in terminal mode, at the "Command:"
  74. prompt type "call filename" where filename is the full file name
  75. (including path and extension) of the script to execute.
  76.  
  77.     2) Associate a script file name (once again, full path and
  78. extension) with a dialing directory entry and make connection with
  79. that number.
  80.  
  81.     3) Assign the "call" command to a TE/2 function key.  Set the
  82. macro associated with the function to to "!call filename".  Note
  83. that ANY script command may be associated with a function key using
  84. the exclamation point as the leading character.
  85.  
  86.     4) Run a script automatically when TE/2 starts using the
  87. "-mfilename" command line parameter.  Note that there is one "magic"
  88. script file name "TE2START.SCR" which TE/2 will always execute
  89. automatically at startup if it finds it on the script path.
  90.  
  91.  
  92.  
  93. Program structure:
  94. ==================
  95.  
  96.   The general structure of a TE/2 script file is thus:
  97.  
  98.         variable declarations/definitions
  99.         subroutine definitions
  100.         program body
  101.  
  102.  
  103.  
  104. Constants:
  105. ==========
  106.  
  107.   Numeric Constants
  108.   -----------------
  109.  
  110.   Numeric constants are 32 bit, signed quantities.  A numeric constant
  111. may be expressed in standard decimal, hexadecimal, or octal notation
  112. and may range from -2147483647 to 2147483647.  Some examples of numeric
  113. constants are:
  114.                32, -768, 0x1b, 0333, 0x12345678
  115.  
  116.   There are several built in numeric constants. The most important of
  117. these are TRUE (1) and FALSE (0). There are others that are designed
  118. for special purposes, these will be covered in the appropriate
  119. sections.  Table 1 contains a list of these constants.
  120.  
  121.     Table 1.  -- Built in numeric constants
  122.     ---------------------------------------
  123.                     ansi_bbs
  124.                     ansi_te2
  125.                     ascii
  126.                     false
  127.                     ifcarrier
  128.                     query
  129.                     toggle
  130.                     true
  131.                     tty
  132.                     vt100
  133.                     xmodem
  134.                     xmodem1k
  135.                     ymodem
  136.                     ymodemg
  137.                     zmodem
  138.  
  139.  
  140.   Character Constants
  141.   -------------------
  142.  
  143.   Character constants are really just a special method of specifying
  144. an numeric constant.  A character constant is any single character
  145. between a pair of single quote marks (') or any two character Control
  146. Character sequence (See Table 2. below) between a pair of single
  147. quotes.  The result is the ASCII value of the specified character and
  148. it may be used anywhere a numeric constant or variable is allowed.
  149. To specify the ASCII value of the single quote character (39), simply
  150. use a sequence of three single quotes.
  151.  
  152.   Note that the character constant 'A' is exactly equal to ASCIIVAL("A")
  153. (See function ASCIIVAL below).
  154.  
  155.  
  156.  
  157.   String Constants
  158.   ----------------
  159.  
  160.   String constants are any string of ASCII characters delimited
  161. before and after with double quote marks (").  To embed a quote mark
  162. in a string use a sequence of two double quotes.  For example:
  163.  
  164.         "This string has ""quotes"" embedded into it."
  165.  
  166.   String constants should not exceed 256 characters in length.  This
  167. is not a hard and fast rule though exception handling for long
  168. strings may be less than robust at this point.
  169.  
  170.   The carat (^) character is treated specially, use it to embed
  171. control characters into a string. Table 2 lists all of the valid
  172. conversions.  If a carat character appears in any other situation in
  173. a quoted string it is ignored.  Note that ^! yields character 94
  174. which is itself the carat character, thus "^!" is the method of
  175. embedding the carat character itself into a string.  "^`" is a space
  176. character, this is interesting but not very useful.
  177.  
  178.  
  179.     Table 2.  -- Control character conversions
  180.     --------------------------------------------------------------
  181.        ^@         0        ^L or ^l  12       ^X or ^x  24
  182.        ^A or ^a   1        ^M or ^m  13       ^Y or ^y  25
  183.        ^B or ^b   2        ^N or ^n  14       ^Z or ^z  26
  184.        ^C or ^c   3        ^O or ^o  15       ^[        27
  185.        ^D or ^d   4        ^P or ^p  16       ^\        28
  186.        ^E or ^e   5        ^Q or ^q  17       ^]        29
  187.        ^F or ^f   6        ^R or ^r  18       ^^        30
  188.        ^G or ^g   7        ^S or ^s  19       ^_        31
  189.        ^H or ^h   8        ^T or ^t  20       ^`        32
  190.        ^I or ^i   9        ^U or ^u  21       ^!        94
  191.        ^J or ^j  10        ^V or ^v  22
  192.        ^K or ^k  11        ^W or ^w  23
  193.  
  194.  
  195.   There is one built in string constant, "null" which specifies the
  196. absence of a string.  Note that "null" is not the same as the string
  197. constant "".  The later is a representation of the empty string
  198. whereas "null" is no string at all; several functions in the TE/2
  199. script language will make a distinction.
  200.  
  201.  
  202. Variables:
  203. ==========
  204.  
  205.   Variable types and scope:
  206.   -------------------------
  207.  
  208.   User defined variables may be either string or integer variables.
  209. An integer variable is capable of holding a signed, 32 bit quantity -
  210. the same as the numeric constants mentioned above while a string
  211. variable may refer to anything expressible with a string constant.
  212.  
  213.   Variables may be local or global in scope.  If a variable is local,
  214. it is in effect for the current script file only; it is released when
  215. the script file ends execution and it is not available in any nested
  216. script file execution.  If a variable is global, it is in effect from
  217. the instant it is declared until TE/2 ends execution and exits back
  218. to the OS/2 prompt and it is available to any script file that
  219. executes thereafter and may even be used at the "Command:" prompt.
  220.  
  221.  
  222.   Declaring variables:
  223.   --------------------
  224.  
  225.   Variables are declared in the first section of the script file,
  226. anywhere before the "PROGRAM" statement except in a "SUBROUTINE"
  227. .. "ENDSUB" block.  A variable declaration has the following form:
  228.  
  229.         [GLOBAL] type name [ = expression ]
  230.  
  231.   If the "GLOBAL" scoping modifier is omitted, the variable is local
  232. in scope.  "type" is either "INTEGER" or "STRING".  A variable name
  233. must begin with an alphabetic character ("A" through "Z"), be
  234. comprised entirely of alphanumeric characters ("A" through "Z" plus
  235. "0" through "9"), and must not conflict with a TE/2 keyword or
  236. predefined variable.  If a GLOBAL variable name coincides with
  237. another GLOBAL variable already defined in another script file, it
  238. will refer to the same entity.  If a LOCAL variable has the same name
  239. as an already defined GLOBAL variable, it takes precedence over the
  240. GLOBAL variable for the duration of the current script file after
  241. which the GLOBAL variable will be reinstated.
  242.  
  243.   The optional initializing expression follows all of the rules given
  244. below for expressions.  Remember that it can't refer to any variables
  245. which are not yet declared.
  246.  
  247.  
  248. Subroutines:
  249. ============
  250.  
  251.   All subroutines must be defined before the "PROGRAM" statement in
  252. the script file.  The general form of a subroutine is:
  253.  
  254.         SUBROUTINE name
  255.           statements
  256.         ENDSUB
  257.  
  258. A subroutine name must begin with an alphabetic character and be
  259. composed entirely of alphanumeric characters.  Unlike variables, the
  260. name may conflict with a TE/2 script language keyword or a variable
  261. name but not with any other subroutine name in that script file.
  262.  
  263.   Rules for the statements in a subroutine are the same as the
  264. general rules given below except that the "RETURN" statement is only
  265. valid within a subroutine.  The "RETURN" statement is not strictly
  266. needed, the subroutine will exit back to the main line of code when
  267. it reaches the "ENDSUB" statement but the "RETURN" statement may be
  268. used to exit the subroutine early.
  269.  
  270.   A subroutine has access to all of the local variables defined in
  271. the script file even though they may have been declared later in the
  272. file.
  273.  
  274.  
  275.  
  276. Program body:
  277. =============
  278.  
  279.   After all variable declarations and subroutine definitions, the
  280. keyword "PROGRAM" is used to indicate the beginning of the main
  281. program body of the script file.  Execution of the script begins at
  282. the very next statement after the "PROGRAM" directive.  The program
  283. is composed of one or more statements.
  284.  
  285.  
  286. Statements:
  287. ===========
  288.  
  289.   A statement may be one of the following:
  290.         an assignment statement
  291.         a TE/2 function call
  292.         a control statement
  293.  
  294.  
  295.   Assignment statements:
  296.   ----------------------
  297.  
  298.   An assignment statement has the following form:
  299.  
  300.         variablename = expression
  301.  
  302. "variablename" must be the name of any LOCAL variable declared within
  303. that script file, any GLOBAL variable declared within some script
  304. file that has executed during this TE/2 session, or any TE/2
  305. system-global variable that is not specifically read-only (see list of
  306. keywords and system variables below).
  307.  
  308.   Depending on the type (INTEGER or STRING) of the variable on the
  309. left hand side, the expression may take either of the following
  310. forms:
  311.  
  312.     String expressions
  313.     ------------------
  314.  
  315.         Either a string variable, string literal, or string valued
  316.       function or the addition (concatenation) of two or more such
  317.       variables, literals or functions.
  318.  
  319.         Examples:
  320.                 stringvar = "fred flinstone"
  321.                 HelloMsg  = "Hello " + strleft("Worldwide", 5) + "^M^J"
  322.  
  323.  
  324.     Integer expressions
  325.     -------------------
  326.  
  327.         Either an integer variable, numeric constant, or integer
  328.       valued function or the algebraic combination of two or more
  329.       such variables, constants, or functions.
  330.  
  331.         Examples:
  332.                 intvar = 12345
  333.                 area = width * length
  334.                 loword = longval & 0x0000ffff
  335.  
  336.         The following operators are available for use in integer
  337.       expressions, given in the order of precedence.  Parenthesis
  338.       may be freely used to ensure the correct order of evaluation
  339.       and/or for clarity and readability.
  340.  
  341.       Table 3. -- Integer arithmetic operators
  342.       ----------------------------------------
  343.             -    Unary minus
  344.             ~    Unary bitwise negation
  345.             !    Unary logical negation
  346.  
  347.             &    Bitwise AND operator
  348.  
  349.             |    Bitwise OR operator
  350.             ^    Bitwise EXCLUSIVE-OR operator
  351.  
  352.             >>   Bitwise shift-right
  353.             <<   Bitwise shift-left
  354.  
  355.             *    Multiplication
  356.             /    Division
  357.             %    Modulus
  358.  
  359.             +    Addition
  360.             -    Subtraction
  361.  
  362.             AND  Logical AND
  363.             OR   Logical OR
  364.  
  365.             >    Relational Greater-Than
  366.             <    Relational Less-Than
  367.             >=   Relational Greater-Than-Or-Equal
  368.             <=   Relational Less-Than-Or-Equal
  369.             !=   Relational Not-Equal
  370.             ==   Relational Equality
  371.  
  372.  
  373.  
  374.   TE/2 Function calls:
  375.   --------------------
  376.  
  377.   The TE/2 script file language has a rich set of built in functions
  378. which are listed alphabetically below in the Function Directory.  In
  379. general, each function has a return value, either INTEGER or STRING
  380. and may appear in the right hand side of an expression as discussed
  381. above but a function (indeed an entire expression, see below) may also
  382. appear on a line of its own in the script file.  In this case the
  383. function is evaluated (usually for its actions or side effects) and
  384. the return value is discarded.  Clearly, this is not advantageous for
  385. some functions such as GETENV or STRLEN whose entire purpose in life
  386. is to return some information however it may be just the ticket for
  387. action functions like CHAT, SCROLLBACK, or even WAITFOR if you aren't
  388. interested in the return value.
  389.  
  390.   It was mentioned that an entire expression could appear on a line
  391. in the script file.  The following is a perfectly valid statement:
  392.  
  393.         waitfor("Select:", 60) + 5 + atoi("1234")
  394.  
  395. however the result (1239 or 1240 if WAITFOR was successful) will be
  396. discarded.  You might be tempted to write:
  397.  
  398.         waitfor("Select:", 60) + transmit("m^M")
  399.  
  400. instead of:
  401.  
  402.         waitfor("Select:", 60)
  403.         transmit("m^M")
  404.  
  405. however you should NOT depend on left-to-right evaluation of this
  406. or any expression as it may not be the case in future versions of
  407. TE/2 or in the compiled language when it become available. 
  408. Likewise, Boolean statements (those which use AND, OR, the logical
  409. negation (!), and/or the relational operators are NOT short circuited
  410. once their results are clear (as they are in "C", for instance);
  411. expect all terms of a Boolean expression to be evaluated.
  412.  
  413.  
  414.   Control statements:
  415.   -------------------
  416.  
  417.   The following is a brief summary of the program control structures
  418. available in the TE/2 script language.
  419.  
  420.       Subroutines:
  421.       ------------
  422.  
  423.         GOSUB subname           { subname must be defined in file }
  424.         RETURN                  { valid within a subroutine only }
  425.  
  426.                 Notes: The subroutine has access to all variables
  427.                 that are available at the main line level.  The
  428.                 program location after the GOSUB statement is saved
  429.                 and restored when the RETURN statement is encountered
  430.                 or when an ENDSUB statement is reached.  Subroutines
  431.                 may call other subroutines in the same file. The END
  432.                 statement may be used within the subroutine with the
  433.                 same results as using it in the main program body.
  434.  
  435.  
  436.       IF-ELSEIF-ELSE structure:
  437.       -------------------------
  438.  
  439.         IF num-expression
  440.           statements
  441.         [ELSEIF num-expression  { any number of ELSEIF clauses are }
  442.           statements            { allowed }
  443.         ELSEIF num-expression
  444.           .
  445.           .]
  446.         [ELSE                   { ELSE statement is optional }
  447.           statements]
  448.         ENDIF
  449.  
  450.  
  451.  
  452.       Loop structures:
  453.       ----------------
  454.  
  455.         DO                      { loop forever }
  456.           statements
  457.         LOOP
  458.  
  459.         DO WHILE num-expression
  460.           statements
  461.         LOOP
  462.  
  463.         DO UNTIL num-expression
  464.           statements
  465.         LOOP
  466.  
  467.         DO
  468.           statements
  469.         LOOP WHILE num-expression
  470.  
  471.         DO
  472.           statements
  473.         LOOP UNTIL num-expression
  474.  
  475.         BREAK                   { exit current loop structure }
  476.         CONTINUE                { branch to top of current loop structure }
  477.  
  478.                 Notes: In the DO WHILE..LOOP and DO UNTIL..LOOP
  479.                 structures, the control expression is evaluated at
  480.                 the beginning of the loop, execution may never enter
  481.                 the loop if the expression does not evaluate
  482.                 correctly for that style of loop.  In the DO..LOOP
  483.                 WHILE and DO..LOOP UNTIL forms, the expression is
  484.                 evaluated at the end of the loop, the loop will
  485.                 always be executed at least once.
  486.                 The BREAK statement will exit the current loop
  487.                 structure.  If execution is within nested loops, only
  488.                 the innermost loop will be exited.  The BREAK
  489.                 statement is the only way to exit the first form of
  490.                 the DO..LOOP structure.
  491.                 The CONTINUE statement transfers control back to the
  492.                 top of the loop structure.  If it is of the form
  493.                 DO WHILE..LOOP or DO UNTIL..LOOP, the expression is
  494.                 immediately reevaluated.
  495.  
  496.  
  497.       Other controls:
  498.       ---------------
  499.  
  500.         END                     { terminate current script file even
  501.                                   if currently in subroutine }
  502.  
  503.         STOP                    { terminate current script file and
  504.                                   all calling script files }
  505.  
  506.         RUN(str-expression)     { execute script file - control
  507.                                   returns to current file when called
  508.                                   file ends }
  509.  
  510.         PROCESS                 { recursively execute a TE/2 terminal
  511.                                   session, script file is suspended
  512.                                   until an EXIT() is performed. Note
  513.                                   that Alt-X generates an EXIT() by
  514.                                   default }
  515.  
  516.         EXIT(num-expression)    { terminate current PROCESS level or
  517.                                   terminate TE/2 if not in a PROCESS
  518.                                   shell }
  519.  
  520.   Note that the END statement is not strictly necessary, the script
  521. file will terminate when it reaches the end of the file.
  522.  
  523.   Please note that loop structures, IF blocks and subroutines must be
  524. properly nested.  The TE/2 script language interpreter may detect a
  525. faulty nesting and terminate with an error but the problem may not be
  526. detected in some pathological cases until execution has already
  527. progressed in an erroneous manner for a while.  The following are
  528. examples of incorrect block nesting.
  529.  
  530.     Incorrect nesting:
  531.     ------------------
  532.         counter = 0
  533.         do while counter < 50
  534.           if counter == 25
  535.             loop
  536.           endif
  537.           counter = counter + waitfor("Next", 10)
  538.         loop
  539.  
  540.     Correct nesting:
  541.     ----------------
  542.         counter = 0
  543.         do while counter < 50
  544.           if counter == 25
  545.             continue
  546.           endif
  547.           counter = counter + waitfor("Next", 10)
  548.         loop
  549.  
  550.           
  551.     Incorrect nesting:
  552.     ------------------
  553.         if stricmp(strg1, strg2) == 0
  554.           message("^M^Jwaiting")
  555.           do
  556.             message(".")
  557.         else
  558.             message("!")
  559.           until waitfor(strg2, 1)
  560.         endif
  561.  
  562.  
  563.  
  564. Keywords:
  565. =========
  566.  
  567.   This is a list of reserved words within the TE/2 script language. 
  568. In addition to these words, no user variable may have the same name
  569. as a system-global variable (see below).
  570.  
  571.     Table 4. -- TE/2 script language reserved words
  572.     -----------------------------------------------
  573.      abs              getenv            setphone
  574.      and              gets              setscript
  575.      ansi_bbs         getyesno          settag
  576.      ansi_te2         hangup            setxonxoff
  577.      ascii            ifcarrier         setvt100bksp
  578.      asciival         itoa              setxlattable
  579.      atoi             jdate             sendbreak
  580.      beep             julian            sendbyte
  581.      cancelwatch      julian2           sendinit
  582.      chat             jwday             shell
  583.      chdir            kbdabort          sleep
  584.      chdisk           keypressed        snapshot
  585.      closedialog      lastdownload      sprintf
  586.      cls              lastupload        status
  587.      connected        lfaftercr         strcmp
  588.      curdir           localecho         strdate
  589.      cursorcol        logclose          streval
  590.      cursorrow        logfile           strget
  591.      date             logopen           stricmp
  592.      dial             logpause          strleft
  593.      directory        mainmenu          strlen
  594.      direntry         message           strput
  595.      dirname          muxwait           strright
  596.      dirphone         null              strstr
  597.      dirscript        opendialog        strtime
  598.      dirtag           or                strtrim
  599.      download         parmsmnu          substr
  600.      dumpinit         password          termecho
  601.      emulate          pgmmenu           time
  602.      erase            porthandle        timedout
  603.      errormsg         query             toggle
  604.      execpgm          queuedial         tolower
  605.      exit             redial            toupper
  606.      false            rename            trace
  607.      fnkey            restorescr        transmit
  608.      fclose           rgetc             true
  609.      feof             rgets             tty
  610.      ferror           rshell            upload
  611.      fgetc            savedirfile       vt100
  612.      fgets            savescr           waitfor
  613.      fopen            scrollback        watchfor
  614.      fputc            setctsrts         weekday
  615.      fputs            setcursor         xmodem
  616.      fseek            setname           xmodem1k
  617.      ftell            setparms          ymodem
  618.      getc             setpassword       ymodemg
  619.                                         zmodem
  620.                  
  621.  
  622.  
  623. TE/2 System-Global Variables:
  624. =============================
  625.  
  626.   The following are the system-global variables (those which are
  627. usually set in TE2.INI) which may be referred to in script language
  628. statements.  The type (INTEGER or STRING) of each is given by its
  629. name.  In general, these variables may also appear on the left-hand
  630. side of an assignment statement, i.e.:
  631.  
  632.         modemInitStrg = "ATE0 V1 X6^M^J"
  633.  
  634. Those which cannot be assigned directly are marked with an asterisk.
  635. The marked variables must be set/reset through other means (usually a
  636. function is provided, in some cases only through a TE/2 dialog box or
  637. only from TE2.INI).
  638.  
  639.     Table 5. -- TE/2 system-global variables
  640.     ----------------------------------------------
  641.      * indicates read-only variable w.r.t assignment statements
  642.  
  643.         TermAttr           - INTEGER
  644.         MenuNormAttr       - INTEGER
  645.         MenuHiAttr         - INTEGER
  646.         LogoAttr           - INTEGER
  647.         DLogNormAttr       - INTEGER
  648.         DLogHiAttr         - INTEGER
  649.         DLogDaAttr         - INTEGER
  650.         DLogEdAttr         - INTEGER
  651.         DLogEdHiAttr       - INTEGER
  652.         ShadowAttr         - INTEGER
  653.         DialNormAttr       - INTEGER
  654.         DialHiAttr         - INTEGER
  655.         ErrorAttr          - INTEGER
  656.         ScrlBackAttr       - INTEGER
  657.         ScrlBackFdAttr     - INTEGER
  658.         ScrlBackMkAttr     - INTEGER
  659.         ScrlBackTiAttr     - INTEGER
  660.         ChatAttr           - INTEGER
  661.         ChatRemoteAttr     - INTEGER
  662.         ChatTitleAttr      - INTEGER
  663.         CmdPromptAttr      - INTEGER
  664.         CmdInputAttr       - INTEGER
  665.         CmdInputHiAttr     - INTEGER
  666.         SnapShotAttr       - INTEGER
  667.  
  668.         LocalEcho          - INTEGER
  669.         DtrHangUp          - INTEGER
  670.         LFafterCR          - INTEGER
  671.         AutoZM             - INTEGER
  672.         MatchBaud          - INTEGER
  673.         AutoDirSave        - INTEGER
  674.         ChatBuffered       - INTEGER
  675.         Te2DEBUG           - INTEGER
  676.         AlarmPopUp         - INTEGER
  677.         MenuActive         - INTEGER *
  678.         ColorLock          - INTEGER
  679.         ClsReset           - INTEGER
  680.         QueryZMRecover     - INTEGER
  681.         DialerDC           - INTEGER
  682.         AutoNL3101         - INTEGER
  683.         AutoLF3101         - INTEGER
  684.         Scroll3101         - INTEGER
  685.         EndChar3101        - INTEGER
  686.         NoOvIO             - INTEGER
  687.         ExtendedFIFO       - INTEGER
  688.         SwapBS4Del         - INTEGER
  689.         VT100Backspace     - INTEGER *
  690.  
  691.         BreakLen           - INTEGER
  692.         DialerTimeOut      - INTEGER
  693.         AlarmType          - INTEGER
  694.         AlarmTime          - INTEGER
  695.         ForceLines         - INTEGER
  696.         ScrlBackLns        - INTEGER *
  697.         RedialDelay        - INTEGER
  698.         LogoDelay          - INTEGER
  699.         QueryHangUp        - INTEGER
  700.         ClobberDL          - INTEGER
  701.         DialerSendInit     - INTEGER
  702.  
  703.         ModemInitStrg      - STRING
  704.         ModemDialStrg      - STRING
  705.         ModemDialSufx      - STRING
  706.         ModemHangStrg      - STRING
  707.         ModemAnsStrg       - STRING
  708.         ModemOKStrg        - STRING
  709.         ModemDelayChar     - INTEGER
  710.         EnqReply           - STRING
  711.         VT100Prn           - STRING
  712.  
  713.         CallLog            - STRING  *
  714.         LogPath            - STRING
  715.         UploadPath         - STRING
  716.         DownloadPath       - STRING
  717.         ScriptPath         - STRING
  718.         ShellCmd           - STRING
  719.         DIRFile            - STRING *
  720.         FNKFile            - STRING *
  721.         XEXFile            - STRING *
  722.  
  723.         Device             - STRING  *
  724.         Port               - INTEGER *
  725.         Baud               - INTEGER *
  726.         Parity             - INTEGER *
  727.         WordLen            - INTEGER *
  728.         StopBits           - INTEGER *
  729.         XonXoff            - INTEGER *
  730.         CtsRts             - INTEGER *
  731.  
  732.         ULPrtyClass        - INTEGER
  733.         DLPrtyClass        - INTEGER
  734.  
  735.  
  736. Other System variables:
  737. =======================
  738.  
  739.   The following are other read-only variables, maintained by the
  740. system which may not be set in any way.  Their values may only be
  741. examined.
  742.  
  743.          Connected    - INTEGER, TRUE if TE/2 is online
  744.          CurDir       - STRING, the current subdirectory
  745.          CursorCol    - INTEGER, current horizontal postion of the
  746.                           cursor, leftmost column is 0
  747.          CursorRow    - INTEGER, current vertical position of the
  748.                           cursor, topmost row is 0
  749.          Date         - INTEGER, the current date in packed format
  750.          Time         - INTEGER, the current time in packed format
  751.          TimedOut     - INTEGER, TRUE if last WAITFOR, MUXWAIT, RGETS
  752.                           ended because of a timeout
  753.          KbdAbort     - INTEGER, TRUE if last WAITFOR, MUXWAIT, RGETS
  754.                           ended because of ESCape was typed
  755.          KeyPressed   - INTEGER, TRUE if a local keystroke is pending
  756.          LastUpload   - STRING, the name of the most recently uploaded
  757.                           file or "" if no uploads have occurred
  758.          LastDownload - STRING, the name of the most recently downloaded
  759.                           file or "" if no downloads have occurred
  760.          Porthandle   - INTEGER, the OS/2 file handle for the open com port
  761.          StrDate      - STRING, the current date in string format
  762.          StrTime      - STRING, the current time in string format
  763.          Weekday      - STRING, the current day of the week, one
  764.                           of: "Sun", "Mon", "Tue", "Wed", "Thu",
  765.                           "Fri", or "Sat".
  766.  
  767.   Note: the formats of the date and time strings are determined by
  768. querying OS/2 for the current codepage.
  769.  
  770.   Note: the formats of the date and time numeric variables are:
  771.  
  772.           year   = (date & 0xffff0000) >> 16
  773.           month  = (date & 0x0000ff00) >> 8
  774.           day    =  date & 0x000000ff
  775.  
  776.           hour   = (time & 0xff000000) >> 24
  777.           minute = (time & 0x00ff0000) >> 16
  778.           second = (time & 0x0000ff00) >> 8
  779.           hunds  =  time & 0x000000ff
  780.  
  781.  
  782.  
  783.  
  784. Function directory:
  785. ===================
  786.  
  787.   All functions are invoked by giving their names plus a pair of
  788. parentheses containing the list of arguments.  In some cases, a
  789. function may not require an argument list, in these cases the empty
  790. parentheses are still required.
  791.  
  792.   In the function directory below, the format is: the function name
  793. is listed and, in the parentheses, the type of each required argument
  794. is given.  If no arguments are required, the word "void" appears in
  795. the parentheses.  Some functions receive "special" parameters;
  796. usually these will be taken from a select set of predefined constants
  797. (as mentioned in the section on constants above).  In these cases,
  798. the word "special" will appear in that argument position and an
  799. explanation will be given in the text.  If a function takes a
  800. variable number of arguments, this is indicated by ending the
  801. argument list with three dots ("...").
  802.  
  803.  
  804.     ABS(integer)
  805.         Returns: INTEGER, the absolute value of its argument
  806.  
  807.  
  808.     ASCIIVAL(string)
  809.         Returns: INTEGER, the ASCII value of the first character of
  810.                           its argument
  811.  
  812.  
  813.     ATOI(string)
  814.         Returns: INTEGER, the numeric value of the argument
  815.         Notes:  this function understands hex and octal notation,
  816.                 thus ATOI("27") and ATOI("0x1b") and ATOI("033")
  817.                 all return the same value, 27.
  818.  
  819.  
  820.     BEEP(integer, integer)
  821.         Returns: INTEGER, always TRUE
  822.         Notes:  this function will sound the console beeper, the
  823.                 first parameter specifies the frequency (pitch) of
  824.                 the sound, the second the duration.
  825.  
  826.  
  827.     CANCELWATCH(integer)
  828.         Returns: INTEGER, TRUE or FALSE
  829.         Notes:  The argument must be a 'watch handle' created via a
  830.                 previous call to WATCHFOR.  This function releases
  831.                 the watch.  It returns FALSE if the watch did not
  832.                 exist, TRUE otherwise.
  833.                 See also WATCHFOR.
  834.  
  835.     CHAT(void)
  836.         Returns: INTEGER, always TRUE
  837.         Notes:  Activates chat mode, same as Alt-G from terminal mode
  838.  
  839.  
  840.     CHDIR(string)
  841.         Returns: INTEGER, TRUE or FALSE
  842.         Notes:  the argument specifies a subdirectory, this function
  843.                 will attempt to change the current working directory
  844.                 on the current or specified disk, it will NOT change
  845.                 the currently logged disk however.  CHDIR returns
  846.                 TRUE if it was successful. (See CHDISK)
  847.         Examples:
  848.                 CHDIR("D:\")
  849.                 CHDIR("\comm\log")
  850.  
  851.  
  852.     CHDISK(string)
  853.         Returns: INTEGER, TRUE or FALSE
  854.         Notes:  the first character of the argument should specify a
  855.                 disk letter.  This function will attempt to make that
  856.                 the current drive.  It returns TRUE if it was
  857.                 successful. (See CHDIR)
  858.  
  859.  
  860.     CLOSEDIALOG(integer)
  861.         Returns: INTEGER, always TRUE
  862.         Notes:  The argument MUST be a handle to a dialog that has
  863.                 been created by an earlier call to OPENDIALOG.
  864.                 Restores the area of the screen which was saved during
  865.                 the OPENDIALOG call and frees up all memory associated
  866.                 with this dialog.
  867.  
  868.  
  869.     CLS(void)
  870.         Returns: INTEGER, always TRUE
  871.         Notes:  Clears the terminal screen to the current attribute.
  872.  
  873.  
  874.     DIAL(string OR integer)
  875.         Returns: INTEGER, TRUE or FALSE
  876.         Notes:  If the argument is an integer or if it is a string
  877.                 with the format "#nnn" where the n's are digits, DIAL
  878.                 will attempt to dial the indicated entry in the
  879.                 current dialing directory.  If it is a string and
  880.                 not "#nnn" format, then if the first character is a
  881.                 digit it will manually dial the string, else if the
  882.                 string is not empty it will search for a TAG in the
  883.                 current dialing directory that matches and dial that
  884.                 entry.  If the string is empty, the user is prompted
  885.                 for a number (this is equivalent to typing Alt-M from
  886.                 terminal mode).  DIAL returns TRUE if a connection
  887.                 was made.
  888.  
  889.  
  890.     DIRECTORY(void)
  891.         Returns: INTEGER, TRUE or FALSE
  892.         Notes:  This is equivalent to typing Alt-D from terminal
  893.                 mode.  DIRECTORY returns TRUE if a connection was
  894.                 made.
  895.  
  896.  
  897.     DIRNAME(string)
  898.         Returns: STRING
  899.         Notes:  The parameter is either a "tag" to search for in
  900.                 the currently loaded dialing directory or it may be
  901.                 "" in which case it refers to the most recently dialed
  902.                 entry.  Returns the value of the "Name" field in the
  903.                 specified entry or "" if it could not be located.
  904.  
  905.     DIRPHONE(string)
  906.         Returns: STRING
  907.         Notes:  The parameter is either a "tag" to search for in
  908.                 the currently loaded dialing directory or it may be
  909.                 "" in which case it refers to the most recently dialed
  910.                 entry.  Returns the value of the "Number" field in the
  911.                 specified entry or "" if it could not be located.
  912.  
  913.     DIRSCRIPT(string)
  914.         Returns: STRING
  915.         Notes:  The parameter is either a "tag" to search for in
  916.                 the currently loaded dialing directory or it may be
  917.                 "" in which case it refers to the most recently dialed
  918.                 entry.  Returns the value of the "Script" field in the
  919.                 specified entry or "" if it could not be located.
  920.  
  921.     DIRTAG(string)
  922.         Returns: STRING
  923.         Notes:  The parameter is either a "tag" to search for in
  924.                 the currently loaded dialing directory or it may be
  925.                 "" in which case it refers to the most recently dialed
  926.                 entry.  Returns the value of the "Tag" field in the
  927.                 specified entry or "" if it could not be located.
  928.  
  929.     DOWNLOAD(special, string)
  930.         Returns: INTEGER, TRUE or FALSE
  931.         Notes:  The "special" parameter must be one of the following
  932.                 pre-defined constants: XMODEM, XMODEM1K, YMODEM,
  933.                 YMODEMG, ZMODEM, or QUERY.  If this parameter is
  934.                 QUERY, the user is prompted for the protocol.  The
  935.                 second parameter is the file name, if it is the empty
  936.                 string, XMODEM and XMODEM1K will prompt the user for
  937.                 the filename, this parameter is ignored by YMODEM,
  938.                 YMODEMG, and ZMODEM.
  939.                 The function returns TRUE if the file transfer ended
  940.                 with no fatal errors.  (See UPLOAD)
  941.  
  942.  
  943.     DUMPINIT(void)
  944.         Returns: INTEGER, always TRUE
  945.         Notes:  Prints the current value of all the system-global
  946.                 values settable via TE2.INI to the terminal screen.
  947.  
  948.  
  949.     EMULATE(special)
  950.         Returns: INTEGER, the new emulation.
  951.         Notes:  The "special" parameter must be one of the following
  952.                 pre-defined constants: TTY, ANSI_BBS, ANSI_TE2,
  953.                 VT100, or QUERY.  If it is QUERY, the user is
  954.                 prompted for the emulation.
  955.  
  956.  
  957.     ERASE(string)
  958.         Returns: INTEGER, 0 on success, -1 on error
  959.         Notes:  This function will delete the indicated file from
  960.                 the disk.  Clearly, you should use this function
  961.                 with care.
  962.  
  963.     ERRORMSG(string, string)
  964.         Returns: INTEGER, always TRUE
  965.         Notes:  Displays the error message dialog (TE/2 uses this
  966.                 dialog for most all, non-script related errors).
  967.                 String1 is left justified on the first line of the
  968.                 dialog, string2 centered on the second and "Strike
  969.                 any key to continue" is placed at the bottom of the
  970.                 dialog.  ErrorAttr from the initialization file is
  971.                 used for the dialog color.  The portion of the screen
  972.                 overlaid by the dialog is saved and restored when the
  973.                 dialog is exited.
  974.  
  975.  
  976.     EXECPGM(string, string, string, integer, integer)
  977.         Returns: INTEGER
  978.         Notes:  The arguments are, in order, session_title, program_name,
  979.                 program_args, exec_type, and exec_flags.  These parameters
  980.                 map directly to the information contained in the external
  981.                 program file that TE/2 uses to build the "User Programs"
  982.                 menu (Alt-J), you should refer to the TE/2 Manual for
  983.                 more information on these settings.  All of the functionality
  984.                 for user input and global value passing that is referred
  985.                 to there is present here.  The exec_flags parameter is NOT
  986.                 optional for this call like it is in the external programs
  987.                 file however.
  988.                 The return value of EXECPGM() depends on the mode in which
  989.                 the child process was executed.  A return value of -1 will
  990.                 usually indicate an invalid parameter list.  If the child
  991.                 was executed in the background or in a new session, the
  992.                 return value is zero for success or the error code which
  993.                 was returned by OS/2.  If the child was executed as a
  994.                 foreground process, the return value is the exit code of
  995.                 the child program (i.e., the value which it passed to
  996.                 DosExit()).
  997.  
  998.  
  999.     EXIT(special)
  1000.         Returns: INTEGER, TRUE or FALSE
  1001.         Notes:  The "special" parameter must be one of the following
  1002.                 pre-defined constants: TRUE, FALSE, IFCARRIER.  If it
  1003.                 is FALSE, the user will be asked for confirmation
  1004.                 before exiting, if TRUE TE/2 will unconditionally
  1005.                 exit, if QUERY the user will be queried only if the
  1006.                 carrier is high (TE/2 is online).
  1007.                 The function returns TRUE if TE/2 is exiting
  1008.                 (although you won't be able to test this, if the
  1009.                 function returns to the script at all it should do so
  1010.                 with FALSE).
  1011.  
  1012.  
  1013.     FNKEY(integer)
  1014.         Returns: INTEGER, TRUE or FALSE
  1015.         Notes:  If the argument is zero or greater than 48, the
  1016.                 function key menu is activated, this is equivalent
  1017.                 to typing Alt-K from terminal mode.  If it is a
  1018.                 number from 1 to 48, the corresponding function key
  1019.                 macro is transmitted.
  1020.                         1 - 12  -> unshifed function keys 1-12
  1021.                        13 - 24  -> shifted function keys 1-12
  1022.                        25 - 36  -> control-function keys 1-12
  1023.                        37 - 48  -> alt-function keys 1-12
  1024.                 The function returns TRUE if a macro was transmitted.
  1025.  
  1026.  
  1027.     FCLOSE(integer)
  1028.         Returns:  INTEGER, TRUE or FALSE
  1029.         Notes:  The argument should be the value returned from an
  1030.                 earlier call to FOPEN (see notes on file handling).
  1031.                 This function returns TRUE if the file was
  1032.                 successfully closed.
  1033.  
  1034.  
  1035.     FEOF(integer)
  1036.         Returns:  INTEGER, TRUE or FALSE
  1037.         Notes:  The argument should be the value returned from an
  1038.                 earlier call to FOPEN (see notes on file handling).
  1039.                 This function returns TRUE if the current file
  1040.                 pointer position is at the end of file.
  1041.  
  1042.  
  1043.     FERROR(integer)
  1044.         Returns:  INTEGER, error code
  1045.         Notes:  The argument should be the value returned from an
  1046.                 earlier call to FOPEN (see notes on file handling).
  1047.                 This function returns FALSE if no error has occurred
  1048.                 accessing the indicated file, else it is an error
  1049.                 code.
  1050.  
  1051.  
  1052.     FGETC(integer)
  1053.         Returns:  INTEGER, character code or -1
  1054.         Notes:  The argument should be the value returned from an
  1055.                 earlier call to FOPEN (see notes on file handling).
  1056.                 This function returns the next character in a file
  1057.                 which has been opened for input.  A -1 result is
  1058.                 used to indicate end-of-file or error (See FEOF and
  1059.                 FERROR).
  1060.  
  1061.  
  1062.     FGETS(integer)
  1063.         Returns:  STRING, input from file
  1064.         Notes:  The argument should be the value returned from an
  1065.                 earlier call to FOPEN (see notes on file handling).
  1066.                 This function reads a line of text from a file opened
  1067.                 for input.  It reads all characters up to and
  1068.                 including a newline character ("^J", see notes on
  1069.                 file handling for information about newline
  1070.                 translation) or 1024 characters, whichever occurs
  1071.                 first. It returns and empty string to indicate
  1072.                 end-of-file or error (See FEOF and FERROR).
  1073.  
  1074.  
  1075.     FOPEN(string, string)
  1076.         Returns: INTEGER, file handle
  1077.         Notes:  This function MAY NOT be called outside the context
  1078.                 of and assignment statement.  It opens a file and
  1079.                 its return value is a "handle" for all the other
  1080.                 file oriented functions (FGETC, FEOF, FCLOSE, etc).
  1081.                 Care should be taken with this value so that it not
  1082.                 altered in any way until FCLOSE has safely been
  1083.                 called.
  1084.                 The first argument is a file name, the second is the
  1085.                 open "mode" and should be one of "r", "w", "a", "rt",
  1086.                 "rb", "wt", "wb", "at", "ab", "r+t", "w+t", "a+t",
  1087.                 "r+b", "w+b", or "a+b" (see notes on file handling
  1088.                 for an explanation).
  1089.                 If the function returns 0, the file was not opened.
  1090.  
  1091.  
  1092.     FPUTC(integer, integer)
  1093.         Returns:  INTEGER, the output character or -1
  1094.         Notes:  The second argument should be the value returned from
  1095.                 an earlier call to FOPEN (see notes on file handling).
  1096.                 The first argument is the ascii value of the
  1097.                 character to be output to the file, the file must
  1098.                 have been opened in a mode which allows writing of
  1099.                 data ("w", "a", etc).  A return value of -1 indicates
  1100.                 an error situation (see FEOF and FERROR).
  1101.  
  1102.  
  1103.     FPUTS(string, integer)
  1104.         Returns:  INTEGER, the last output character or -1
  1105.         Notes:  The second argument should be the value returned from
  1106.                 an earlier call to FOPEN (see notes on file handling).
  1107.                 The first argument is the string to write to the file.
  1108.                 The file must have been opened in a mode which allows
  1109.                 writing of data ("w", "a", etc).  A return value of
  1110.                 -1 indicates an error (see FEOF and FERROR).
  1111.  
  1112.  
  1113.     FSEEK(integer, integer, special)
  1114.         Returns:  INTEGER, TRUE or FALSE
  1115.         Notes:  The first argument should be the value returned from
  1116.                 an earlier call to FOPEN (see notes on file handling).
  1117.                 The second integer specifies an offset into the file
  1118.                 which may be positive, negative, or zero depending
  1119.                 upon the mode specified in the third argument.
  1120.                 This function will attempt to move the current file
  1121.                 location pointer in the indicated file to a number
  1122.                 of bytes (specified in the second argument) from the
  1123.                 origin (specified in the third argument).  The third
  1124.                 argument MUST be one of:
  1125.                         0 -- beginning of file
  1126.                         1 -- current position in file
  1127.                         2 -- end of file
  1128.                 If this function returns false, an error has occurred.
  1129.                 (see FEOF and FERROR)
  1130.  
  1131.  
  1132.     FTELL(integer)
  1133.         Returns:  INTEGER, 
  1134.         Notes:  The argument should be the value returned from an
  1135.                 earlier call to FOPEN (see notes on file handling).
  1136.                 This function retrieves the current location pointer
  1137.                 in the indicated file.  A return value of -1
  1138.                 indicates an error (see FOEF and FERROR).
  1139.  
  1140.  
  1141.     GETC(void)
  1142.         Returns: INTEGER, keystroke value or zero
  1143.         Notes:  Waits for the user to type a key and returns the value
  1144.                 of the keystroke.  If an error occurred, the return
  1145.                 is zero, if it was a 'standard' key, the return is
  1146.                 the ASCII value of the keystroke, if it was an
  1147.                 'extended' key (i.e., Alt key or function key) it
  1148.                 returns the scan code of the key times 256.  The
  1149.                 keystroke is NOT echoed to the terminal screen.
  1150.                 (See GETS)
  1151.  
  1152.  
  1153.     GETENV(string)
  1154.         Returns: STRING
  1155.         Notes:  This function will scan the OS/2 environment table
  1156.                 for the current process (TE/2) and retrieve the value
  1157.                 associated with the string specified in its argument
  1158.                 or the empty string if the argument was not found in
  1159.                 the environment.
  1160.         Examples:
  1161.                 CmdExe = GETENV("COMSPEC")
  1162.                 MESSAGE("%s", GETENV("PROMPT"))
  1163.  
  1164.  
  1165.     GETYESNO(string, string, integer)
  1166.         Returns: INTEGER, User selection result
  1167.         Notes:  Displays the Yes/No dialog (TE/2 uses this dialog
  1168.                 for querying the user for hangup and exit).  Both
  1169.                 strings are centered in the dialog, string2 may be
  1170.                 NULL.  The integer determines the default answer
  1171.                 (TRUE for Yes, FALSE for No). DLogNormAttr and
  1172.                 DLogHiAttr from the initialization file are used for
  1173.                 the dialog colors. The portion of the screen overlaid
  1174.                 by the dialog are saved and restored when the dialog
  1175.                 is exited.
  1176.                 Returns TRUE if "Yes" was selected, FALSE if "No" was
  1177.                 selected.
  1178.  
  1179.  
  1180.     GETS(integer)
  1181.         Returns: STRING
  1182.         Notes:  Gets a string from the console at the current cursor
  1183.                 location.  The argument specifies the maximum length
  1184.                 of the string, it may be a number from 1 to 255.  If
  1185.                 it is less than one, an empty string is immediately
  1186.                 returned, if it is greater than 255, it is treated as
  1187.                 if it were 255.  GETS retrieves a string from the
  1188.                 user up to, but not including the first carriage
  1189.                 return character or the maximum length whichever
  1190.                 occurs first.  Backspace will erase the previous
  1191.                 character typed (if any) and the ESCape key will
  1192.                 immediately terminate the input and GETS will return
  1193.                 an empty string.  If terminal display is turned on
  1194.                 (see TERMECHO) the input is echoed to the terminal
  1195.                 screen in the current attribute and at the current
  1196.                 cursor location.  (See GETC)
  1197.  
  1198.  
  1199.     HANGUP(special)
  1200.         Returns: INTEGER, TRUE or FALSE
  1201.         Notes:  The "special" argument must be one of TRUE, FALSE, or
  1202.                 IFCARRIER.  If FALSE, the hangup sequence will be
  1203.                 unconditionally performed, if TRUE the user will be
  1204.                 queried for permission, if IFCARRIER, the user will
  1205.                 be queried only if the carrier is high (TE/2 is
  1206.                 online).  The function returns TRUE if the hangup
  1207.                 sequence was successfully transmitted and TE/2 is
  1208.                 no longer on line.
  1209.                 NOTE: The parameter for the HANGUP() statement will
  1210.                   override the current setting of the TE/2 QueryHangUp
  1211.                   initialization variable.
  1212.  
  1213.  
  1214.     ITOA(integer, special)
  1215.         Returns: STRING, ASCII representation of the argument
  1216.         Notes:  The "special" argument must be in the range 2-36,
  1217.                 it specifies the radix for the conversion (number
  1218.                 system base.  If the radix is 10 and the value of
  1219.                 the first argument is negative, a leading '-' sign
  1220.                 is the first character of the result.
  1221.         Examples:
  1222.                 ITOA(1234, 10) returns "1234"
  1223.                 ITOA(8, 2)     returns "1000"
  1224.  
  1225.  
  1226.     JDATE(integer, integer)
  1227.         Returns:  INTEGER, A packed date (in the same format as the
  1228.                   'date' read-only variable) based on the given Julian
  1229.                   day number in the first parameter. Returns 0 on error.
  1230.         Notes:  The first parameter is the Julian Day Number to
  1231.                 translate, the second is a Boolean switch.  If the
  1232.                 second parameter is TRUE, the returned date will be
  1233.                 relative to the Gregorian Calendar otherwise it will
  1234.                 be relative to the Julian Calendar.  If the Julian
  1235.                 Day Number is invalid or the results would be out of
  1236.                 bounds for the requested calendar, the return value
  1237.                 will be 0. (See discussion on Julian date conversions
  1238.                 elsewhere in this document.)
  1239.  
  1240.  
  1241.     JULIAN(integer, integer)
  1242.         Returns:  INTEGER, Julian Day Number or -1 on error.
  1243.         Notes:  The first parameter must be a packed date in the same
  1244.                 format as the 'date' read-only variable.  The second
  1245.                 parameter indicates which calendar to use when
  1246.                 translating the date: TRUE means that this is a
  1247.                 Gregorian date, FALSE implies a Julian date.  The
  1248.                 return value is the Julian Day Number for the given
  1249.                 date.  If the date is invalid for the indicated
  1250.                 calendar, this function returns -1. (See discussion
  1251.                 on Julian date conversions elsewhere in this
  1252.                 document.)
  1253.  
  1254.  
  1255.     JULIAN2(integer, integer, integer, integer)
  1256.         Returns:  INTEGER, Julian Day Number or -1 on error.
  1257.         Notes:  The parameters are, in order: month number (1 to 12),
  1258.                 day number (1 to 31), year number, and a Boolean to
  1259.                 indicate which calendar to use when translating this
  1260.                 date: TRUE means that this is a Gregorian date, FALSE
  1261.                 inplies a Julian Date.  The return value is the Julian
  1262.                 Day Number for the given date.  If the date is invalid
  1263.                 for the indicated calendar, this function returns -1.
  1264.                 (See discussion on Julian date conversions elsewhere in
  1265.                 this document.)
  1266.  
  1267.  
  1268.     JWDAY(integer)
  1269.         Returns: INTEGER, weekday index (0 to 6) or -1 on error.
  1270.         Notes:  The single parameter is a Julian Day Number, the
  1271.                 function will return the weekday index for that
  1272.                 Julian Day (0 is Sunday).  If the Julian Day number
  1273.                 is invalid, the function returns -1.
  1274.  
  1275.  
  1276.     LFAFTERCR(special)
  1277.         Returns: INTEGER, TRUE or FALSE, the new value of LFafterCR
  1278.         Notes:  The "special" parameter must be one of TRUE, FALSE,
  1279.                 or TOGGLE.  If TRUE or FALSE, the value of the
  1280.                 LF-After-CR flag is set to that value, if it is
  1281.                 TOGGLE the flag becomes TRUE if it was FALSE and
  1282.                 vice-versa.
  1283.  
  1284.  
  1285.     LOCALECHO(special)
  1286.         Returns: INTEGER, TRUE or FALSE, the new value of LocalEcho
  1287.         Notes:  The "special" parameter must be one of TRUE, FALSE,
  1288.                 or TOGGLE.  If TRUE or FALSE, the value of the
  1289.                 Local-Echo flag is set to that value, if it is
  1290.                 TOGGLE the flag becomes TRUE if it was FALSE and
  1291.                 vice-versa.
  1292.  
  1293.  
  1294.     LOGCLOSE(void)
  1295.         Returns: INTEGER, TRUE or FALSE
  1296.         Notes:  Closes the currently open log file and returns TRUE,
  1297.                 if there is no currently open log file no action is
  1298.                 performed and the function returns FALSE.
  1299.  
  1300.  
  1301.     LOGFILE(void)
  1302.         Returns: INTEGER, TRUE or FALSE
  1303.         Notes:  This is equivalent to typing Alt-L in terminal mode.
  1304.                 If a log file is currently open this function will
  1305.                 close it and return TRUE, else the user will be
  1306.                 prompted for a log file name to open.  In this case
  1307.                 it returns TRUE if a log file was opened or FALSE if
  1308.                 the user typed ESCape at the prompt of if there was
  1309.                 an error opening the file.
  1310.  
  1311.  
  1312.     LOGOPEN(string, integer)
  1313.         Returns: INTEGER, TRUE or FALSE
  1314.         Notes:  The first argument specifies the log file to open.
  1315.                 This must contain the entire path/name of the file,
  1316.                 default logpath handling is NOT performed on this
  1317.                 string.  The second argument should be TRUE if the
  1318.                 the log file should overwrite any existing file of
  1319.                 the same name, if FALSE, new data will be appended
  1320.                 to the file.
  1321.                 If the first argument is NULL, the user will be
  1322.                 prompted for the file name and overwrite/append mode,
  1323.                 the second parameter is ignored.
  1324.                 The function returns TRUE is a log file was
  1325.                 successfully opened, FALSE if the file was not opened
  1326.                 due to error or user intervention.
  1327.  
  1328.  
  1329.     LOGPAUSE(special)
  1330.         Returns: INTEGER, TRUE or FALSE
  1331.         Notes:  The "special" argument must be one of TRUE, FALSE, or
  1332.                 TOGGLE.  If TRUE, the log file will be placed in the
  1333.                 paused state, if FALSE it will be made active, if
  1334.                 TOGGLE it will alternate states.  The function
  1335.                 returns TRUE if an action was performed, if there is
  1336.                 no currently open log file, it will return FALSE.
  1337.  
  1338.  
  1339.     MAINMENU(special)
  1340.         Returns: INTEGER, TRUE or FALSE
  1341.         Notes:  The "special" argument must be one of TRUE, FALSE, or
  1342.                 TOGGLE.  If TRUE, the TE/2 main menu will be
  1343.                 displayed, if FALSE it will be hidden, if TOGGLE it
  1344.                 will alternate states.  The function returns TRUE if
  1345.                 the menu state was changed.  Note that the
  1346.                 system-global variable "MenuActive" may be examined
  1347.                 to determine the current state of the menu.
  1348.  
  1349.  
  1350.     MESSAGE(string, ... )
  1351.         Returns: INTEGER, the length of the message string
  1352.         Notes:  MESSAGE takes a parameter list identical to the
  1353.                 SPRINTF function, refer to SPRINTF for a more
  1354.                 complete discussion of the format string and its
  1355.                 arguments.  This function will build a string
  1356.                 according to the rules for SPRINTF and display it
  1357.                 on the terminal screen at the current cursor
  1358.                 location.
  1359.  
  1360.  
  1361.     MUXWAIT(string, integer)
  1362.         Returns: INTEGER
  1363.         Notes:  Very much like the related WAITFOR function, MUXWAIT
  1364.                 allows you to specify, in the its first argument, as
  1365.                 many as 10 strings to wait for.  The first character
  1366.                 of the string argument defines the delimiter that
  1367.                 will be in effect for parsing the seperate wait
  1368.                 strings.  This may be any character you choose bit it
  1369.                 should be a character that does not otherwise appear
  1370.                 in any of the substrings (see the examples). MUXWAIT
  1371.                 does not return until one of the specified strings
  1372.                 has been encountered at the comm port, the duration
  1373.                 in seconds specified in the second argument has
  1374.                 elapsed, or the user types ESCape, whichever occurs
  1375.                 first.  Returns the index of the string which was
  1376.                 found or FALSE if a timeout occured or the wait was
  1377.                 aborted by typing ESCape.
  1378.                 Incoming characters are echoed to the terminal screen
  1379.                 unless terminal display is turned off, the log file
  1380.                 is maintained.  (See WAITFOR, WATCHFOR)
  1381.                 If the second parameter is less than zero, normal
  1382.                 timeout processing is disabled and MUXWAIT will not
  1383.                 return until a string has been matched or an ESCape
  1384.                 is typed at the keyboard.
  1385.         Examples:
  1386.                 MUXWAIT("/ENTER to continue/Select:/", 60)
  1387.                         The above example will wait up to 60 seconds
  1388.                         for either the string "ENTER to continue" or
  1389.                         "Select:" to appear at the comm port.  If,
  1390.                         for instance, "Select:" was encountered, the
  1391.                         function returns 2.
  1392.                 MUXWAIT("!Enter name/userid:!What system?!", 30)
  1393.                         Note the use of "!" as the delimiter in this
  1394.                         example rather than the "/" used in the
  1395.                         first.  This example needs to use the slash
  1396.                         as a valid character in one of its searches
  1397.                         thus the different delimiter is mandated.
  1398.  
  1399.  
  1400.     OPENDIALOG(integer, integer, integer, integer, integer)
  1401.         Returns: INTEGER, handle to created dialog
  1402.         Notes:  Creates a dialog box on screen complete with frame
  1403.                 and shadow.  The arguments are, in order, top row,
  1404.                 left column, bottom row, right column, and color
  1405.                 attribute.  The contents of the portion of the screen
  1406.                 overlaid by the dialog box are saved and will be
  1407.                 restored with a subsequent call to CLOSEDIALOG.
  1408.                 The return value is a 'handle' to the dialog.
  1409.  
  1410.  
  1411.     PARMSMNU(void)
  1412.         Returns: INTEGER, always FALSE
  1413.         Notes:  This is equivalent to typing Alt-P from terminal
  1414.                 mode.  The system-global variables "Device", "Port",
  1415.                 "Baud", "WordLen", and "StopBits" may be examined
  1416.                 to determine the current line settings at any time.
  1417.  
  1418.  
  1419.     PASSWORD(string)
  1420.         Returns: STRING
  1421.         Notes:  The parameter is either a "tag" to search for in
  1422.                 the currently loaded dialing directory or it may be
  1423.                 "" in which case it refers to the most recently dialed
  1424.                 entry.  Returns the value of the "Password" field in the
  1425.                 specified entry or "" if it could not be located.
  1426.  
  1427.     PGMMENU(void)
  1428.         Returns: INTEGER, always TRUE
  1429.         Notes:  This is equivalent to typing Alt-J in terminal mode.
  1430.  
  1431.  
  1432.     QUEUEDIAL(void)
  1433.         Returns: INTEGER, TRUE or FALSE
  1434.         Notes:  This is equivalent to typing Alt-Q in terminal mode
  1435.                 or "Q" in the dialing directory in that it activates
  1436.                 the Queue Dialer.  The function returns TRUE if a
  1437.                 connection resulted.
  1438.  
  1439.  
  1440.     REDIAL(void)
  1441.         Returns: INTEGER, TRUE or FALSE
  1442.         Notes:  This is equivalent to typing Alt-R in terminal mode in
  1443.                 that the Redialer is activated.  The function returns
  1444.                 TRUE is a connection resulted.
  1445.  
  1446.  
  1447.     RENAME(string, string)
  1448.         Returns: INTEGER, TRUE or FALSE
  1449.         Notes:  This function will attempt to rename the file
  1450.                 specified in the first argument to the new name given
  1451.                 in the second argument.  The function returns TRUE if
  1452.                 it was successful, otherwise an error has occurred.
  1453.                 Further note, this function may be used to move a
  1454.                 file from one subdirectory to another on the same
  1455.                 disk but not across disks.
  1456.         Examples:
  1457.                 RENAME("logfile.log", "logfile.bak")
  1458.                 RENAME("somefile.dat", "\safe\place\somefile.dat")
  1459.  
  1460.  
  1461.     RESTORESCR(integer)
  1462.         Returns: INTEGER, always TRUE
  1463.         Notes:  The argument MUST be a handle to a saved screen that
  1464.                 has been created via an earlier call to SAVESCR or
  1465.                 disaster is sure to follow.  This function will restore
  1466.                 a previously saved screen setup, restoring the video
  1467.                 mode (if neccessary), cursor position, size, and
  1468.                 attribute, and the entire contents of the screen and
  1469.                 frees up all memory used by SAVESCR.
  1470.  
  1471.  
  1472.     RGETC(integer, special)
  1473.         Returns: INTEGER, received character or 0
  1474.         Notes:  This function retrieves one byte of incoming data.
  1475.                 The integer parameter specifies the timeout value in
  1476.                 seconds.  If the timeout period elapses or the user
  1477.                 types an ESCape at the console before a byte of
  1478.                 information is received, RGETC returns 0.
  1479.                 The second, special parameter determines how TE/2 will
  1480.                 echo the character back to the sender.  It may be an
  1481.                 integer or a string.  If it is an integer and is non-zero
  1482.                 then the character will be echoed back to the sender,
  1483.                 if it is zero, or if it is an empty or NULL string,
  1484.                 no character is echoed.  Otherwise, the first character
  1485.                 of the string is echoed back to the sender (use this
  1486.                 for remote entry of passwords, for instance).
  1487.                 Note that by specifying a number less than zero as the
  1488.                 timeout parameter, timeout processing is disabled.
  1489.                 Incoming characters are echoed to the terminal screen
  1490.                 unless terminal display is turned off, the log file
  1491.                 is maintained.
  1492.                 Backspaces are processed and filtered by RGETS before
  1493.                 returning, if echoing is enabled, backspaces,
  1494.                 carriage returns, and line feeds are echoed as
  1495.                 themselves regardless of any translation specified
  1496.                 in parameter 2. (See RGETS)
  1497.  
  1498.  
  1499.     RGETS(integer, integer, special)
  1500.         Returns: STRING, the received data
  1501.         Notes:  This function retrieves incoming data into a string
  1502.                 variable up to the first carriage return or the
  1503.                 string length specified in the first argument or
  1504.                 until the number of seconds specified in the second
  1505.                 argument has elapsed, or until the user types an
  1506.                 ESCape character at the console, whichever occurs first. 
  1507.                 The third, special parameter determines how TE/2 will
  1508.                 echo the characters back to the sender.  It may be an
  1509.                 integer or a string.  If it is an integer and is non-zero
  1510.                 then the characters will be echoed back to the sender,
  1511.                 if it is zero, or if it is an empty or NULL string,
  1512.                 no characters are echoed.  Otherwise, the first character
  1513.                 of the string is echoed back to the sender for each
  1514.                 received character. (use this for remote entry of
  1515.                 passwords, for instance).
  1516.                 Note that by specifying a number less than zero as the
  1517.                 timeout parameter, timeout processing is disabled.
  1518.                 Incoming characters are echoed to the terminal screen
  1519.                 unless terminal display is turned off, the log file
  1520.                 is maintained.
  1521.                 Backspaces are processed and filtered by RGETS before
  1522.                 returning, if echoing is enabled, backspaces,
  1523.                 carriage returns, and line feeds are echoed as
  1524.                 themselves regardless of any translation specified
  1525.                 in parameter 3.
  1526.                 If the length parameter evaluates to 1, backspaces
  1527.                 are NOT filtered or translated.
  1528.                 (See RGETC)
  1529.  
  1530.  
  1531.     RSHELL(string, string, integer)
  1532.         Returns: INTEGER
  1533.         Notes:  Similar in many ways to the SHELL function but subtly
  1534.                 different in several important aspects.  The first string
  1535.                 specifies a program to be executed, the second its arguments.
  1536.                 The program argument MUST be specified, there is no default
  1537.                 value.  When the program is executed, the standard input,
  1538.                 standard output, and standard error system handles are all
  1539.                 redirected to the comm port.  Thus, any program which takes
  1540.                 its input from stdin and writes to stdout and/or stderr,
  1541.                 will receive its input now from the comm port and send its
  1542.                 output back out the comm port.
  1543.                 If the third, integer parameter is non-zero TE/2 will
  1544.                 continue to monitor the status of the connection while the
  1545.                 child process is running.  If a loss of carrier is detected,
  1546.                 the child program will be aborted and control will return
  1547.                 to your script file.
  1548.                 TE/2's screen wil be saved and cleared before executing the
  1549.                 RSHELL program and restored upon return.
  1550.                 The return value is -1 if there was an error otherwise it is
  1551.                 the return code of the program.
  1552.                 RSHELL processes incoming backspace characters
  1553.                 in the expected fashion.
  1554.                 The meaning of the third parameter has been
  1555.                 expanded.  The parameter may take any of the
  1556.                 following values either singly or ORed together:
  1557.                       1 --> watch carrier
  1558.                       2 --> echo incoming characters
  1559.                       4 --> translate cr == cr-lf
  1560.                       8 --> buffer remote input & translate backspaces
  1561.                 Any other bits set in the parameter are ignored.
  1562.                 While in the RSHELL, the remote user has several
  1563.                 special key sequences available that will modify the
  1564.                 behavior.  Each begins with a Control-Backslash
  1565.                 (^\, ascii code 28):
  1566.                       ^\e --> toggles echoing of characters
  1567.                       ^\x --> toggles cr-crlf translation
  1568.                       ^\b --> toggles buffering
  1569.                 Anything else following a ^\ is simply passed
  1570.                 through unchanged (thus ^\^\ == ^\).  Note that the
  1571.                 character codes ARE case sensitive, that is, ^\B is
  1572.                 not the same thing as ^\b.  More special codes may
  1573.                 be added in the future.
  1574.  
  1575.  
  1576.     SAVEDIRFILE(string)
  1577.         Returns: INTEGER, 0 on success or an eror code
  1578.         Notes:  Saves the current dialing directory to disk using
  1579.                 the filename specified in the parameter.  If the
  1580.                 parameter is "" then the file will be saved using
  1581.                 its current name.
  1582.  
  1583.     SAVESCR(void)
  1584.         Returns: INTEGER, handle to saved screen information
  1585.         Notes:  Saves the current contents of the entire screen and
  1586.                 returns a 'handle' to the saved information.  This
  1587.                 information includes the current video mode, the
  1588.                 cursor position, the cursor size and attribute as
  1589.                 well as the actual contents of the screen. If SAVESCR
  1590.                 returns zero then there was not sufficient memory
  1591.                 to perform the operation.
  1592.  
  1593.  
  1594.     SCROLLBACK(void)
  1595.         Returns: INTEGER, TRUE or FALSE
  1596.         Notes:  This is equivalent to typing Alt-W from terminal
  1597.                 mode.  The function returns TRUE unless the Scroll
  1598.                 Back feature is disabled in which case it returns
  1599.                 FALSE.
  1600.  
  1601.  
  1602.     SETCTSRTS(integer)
  1603.         Returns: INTEGER, TRUE or FALSE
  1604.         Notes:  Sets the Cts/Rts handling according to the argument:
  1605.                         0  -  CTS/RTS both off
  1606.                         1  -  CTS on, RTS off
  1607.                         2  -  RTS on, CTS off
  1608.                         3  -  CTS/RTS both on
  1609.                 The function returns TRUE if it was successful.
  1610.  
  1611.  
  1612.     SETCURSOR(integer, integer)
  1613.         Returns: INTEGER, TRUE on success, FALSE on error
  1614.         Notes:  Places the cursor at (row, column) on the terminal
  1615.                 screen. This is direct placement independent of the
  1616.                 current terminal emulation.  The origin is (usually)
  1617.                 the upper lefthand corner and is (0,0).  If the current
  1618.                 terminal emulation is VT100 AND the virtual terminal is
  1619.                 in relative cursor addressing mode AND a scroll region
  1620.                 is set, this function will obey the VT100 emulation's
  1621.                 rules for cursor placement relative to scrolling region.
  1622.                 If the requested location is invalid, this function
  1623.                 will return FALSE.
  1624.  
  1625.     SETNAME(string, string)
  1626.         Returns: INTEGET, TRUE or FALSE
  1627.         Notes: The first paramter is a "tag" to search the currently
  1628.                loaded dialing directory for; if it is "" then it is
  1629.                taken to mean the most recently dialed entry.  The
  1630.                "Name" field in that entry will be set to the value
  1631.                of the second parameter.  Return TRUE on success or
  1632.                FALSE on error.
  1633.  
  1634.     SETPARMS(integer, integer, integer, integer, integer)
  1635.         Returns: INTEGER, TRUE or FALSE
  1636.         Notes:  The arguments are Portnumber, baudrate, parity,
  1637.                 wordlength, and stopbits respectively.  SETPARMS
  1638.                 returns TRUE if it was able to set the specified
  1639.                 parameter configuration.  If it was unsuccessful
  1640.                 NONE of the parameters were changed.  If the port
  1641.                 number changes, the original comm port will be
  1642.                 closed and any active connection severed.  If any
  1643.                 of the parameters are to stay the same either the
  1644.                 appropriate system-global variable should be used
  1645.                 or, alternately a -1 in that position.
  1646.         Examples:
  1647.                 SETPARMS(Port, 2400, 0, 8, 0) sets the current
  1648.                   comm port to 2400 baud, no parity, 8 bit word
  1649.                   length and 1 stop bit.
  1650.                 SETPARMS(-1, 2400, 0, 8, 0) is equivalent to the
  1651.                   previous example.
  1652.                 SETPARMS(-1, 9600, -1, -1, -1) sets the current
  1653.                   comm port to 9600 baud and leaves all other
  1654.                   settings alone.
  1655.                 SETPARMS(Port, 9600, Parity, WordLen, StopBits)
  1656.                   is equivalent to the previous example.
  1657.         Further Notes:
  1658.                 The following is a list of the numbers to use for
  1659.                 setting parity, word length, and stop bits:
  1660.  
  1661.                 Parity:
  1662.                         0  -  no parity
  1663.                         1  -  odd parity
  1664.                         2  -  even parity
  1665.                         3  -  mark parity
  1666.                         4  -  space parity
  1667.  
  1668.                 Word Length:
  1669.                         7  -  7 bit words
  1670.                         8  -  8 bit words
  1671.  
  1672.                 Stop Bits:
  1673.                         0  -  1 stop bit
  1674.                         1  -  1.5 stop bits
  1675.                         2  -  2 stop bits
  1676.  
  1677.  
  1678.     SETPASSWORD(string, string)
  1679.         Returns: INTEGET, TRUE or FALSE
  1680.         Notes:  The first paramter is a "tag" to search the currently
  1681.                 loaded dialing directory for; if it is "" then it is
  1682.                 taken to mean the most recently dialed entry.  The
  1683.                 "Password" field in that entry will be set to the value
  1684.                 of the second parameter.  Return TRUE on success or
  1685.                 FALSE on error.
  1686.  
  1687.     SETPHONE(string, string)
  1688.         Returns: INTEGET, TRUE or FALSE
  1689.         Notes:  The first paramter is a "tag" to search the currently
  1690.                 loaded dialing directory for; if it is "" then it is
  1691.                 taken to mean the most recently dialed entry.  The
  1692.                 "Number" field in that entry will be set to the value
  1693.                 of the second parameter.  Return TRUE on success or
  1694.                 FALSE on error.
  1695.  
  1696.     SETSCRIPT(string, string)
  1697.         Returns: INTEGET, TRUE or FALSE
  1698.         Notes:  The first paramter is a "tag" to search the currently
  1699.                 loaded dialing directory for; if it is "" then it is
  1700.                 taken to mean the most recently dialed entry.  The
  1701.                 "Script" field in that entry will be set to the value
  1702.                 of the second parameter.  Return TRUE on success or
  1703.                 FALSE on error.
  1704.  
  1705.     SETTAG(string, string)
  1706.         Returns: INTEGET, TRUE or FALSE
  1707.         Notes:  The first paramter is a "tag" to search the currently
  1708.                 loaded dialing directory for; if it is "" then it is
  1709.                 taken to mean the most recently dialed entry.  The
  1710.                 "Tag" field in that entry will be set to the value
  1711.                 of the second parameter.  Return TRUE on success or
  1712.                 FALSE on error.
  1713.  
  1714.     SETXONXOFF(integer)
  1715.         Returns: INTEGER, TRUE or FALSE
  1716.         Notes:  If the argument is zero, XonXoff processing will be
  1717.                 turned off, if the argument is "1" transmit XonXoff
  1718.                 processing will be enabled, if it is "2" receive
  1719.                 XonXoff processing will be enabled, if it is "3" both
  1720.                 transmit and receive XonXoff processing are enabled.
  1721.                 The system-global variable "XonXoff" may be examined
  1722.                 at any time to determine the current state of XonXoff
  1723.                 processing.  The function returns TRUE if it was
  1724.                 successful.
  1725.  
  1726.  
  1727.     SETVT100BKSP(integer)
  1728.         Returns: INTEGER
  1729.         Notes:  Sets the VT100 emulation backspace translation mode.
  1730.                 If the parameter is TRUE then the VT100 eumlation
  1731.                 will treat incoming Backspace characters (ASCII 8)
  1732.                 as destructive backspaces, if FALSE the VT100 backspace
  1733.                 will be non-destructive.  Returns the previous setting
  1734.                 for the VT100 Backspace handling.
  1735.  
  1736.     SETXLATTABLE(string, integer)
  1737.         Returns: INTEGER
  1738.         Notes:  Reads a new character translation table from the
  1739.                 file specified in the first parameter.  If the second
  1740.                 parameter is zero, the new table will replace the
  1741.                 input character translation table, if it is non-zero,
  1742.                 it will replace the output character translation table.
  1743.                 Returns 0 on success or an error code on failure.
  1744.  
  1745.     SENDBREAK(integer)
  1746.         Returns: INTEGER, the value of its argument
  1747.         Notes:  Will transmit a break signal to the port for the
  1748.                 specified duration in milliseconds.  If a zero value
  1749.                 is specified, the current value of the system-global
  1750.                 variable "BreakLen" is used for the duration.
  1751.  
  1752.  
  1753.     SENDBYTE(integer OR string)
  1754.         Returns: INTEGER, TRUE or FALSE
  1755.         Notes:  Sends the byte specified by either the integer
  1756.                 expression or the first character of the string
  1757.                 expression to the port.  If the character is either
  1758.                 Ctrl-S or Ctrl-Q, the byte is transmitted
  1759.                 immediately.  The function returns TRUE if it was
  1760.                 successful.
  1761.  
  1762.  
  1763.     SENDINIT(void)
  1764.         Returns: INTEGER, TRUE or FALSE
  1765.         Notes:  Transmits the string in the system-global variable
  1766.                 "modemInitStrg" to the comm port.  Returns TRUE if
  1767.                 it was successful.
  1768.  
  1769.  
  1770.     SHELL(string, string)
  1771.         Returns: INTEGER
  1772.         Notes:  Executes the program specified in the first argument
  1773.                 sending it the parameters specified in the second.
  1774.                 If the first argument is NULL, the current value of
  1775.                 the system-global variable "ShellCmd" is used unless
  1776.                 it is also NULL in which case CMD.EXE is executed
  1777.                 with no parameters.  If the first argument is NULL,
  1778.                 the second argument is ignored.  The program is
  1779.                 executed synchronously in the foreground, TE/2 is
  1780.                 suspended while in the shell.  TE/2's screen is saved
  1781.                 before and restored after execution.  The return
  1782.                 value of the function is the return code of the
  1783.                 executed program or -1 if an error occurred.
  1784.                 SHELL(NULL, NULL) is equivalent to typing Alt-O from
  1785.                 terminal mode.
  1786.  
  1787.  
  1788.     SLEEP(integer)
  1789.         Returns: INTEGER, the value of its argument
  1790.         Notes:  Suspends execution of TE/2 for the duration in
  1791.                 milliseconds specified in its argument.
  1792.  
  1793.  
  1794.     SNAPSHOT(string)
  1795.         Returns: INTEGER
  1796.         Notes:  Performs the TE/2 SnapShot function saving its results
  1797.                 to the filename indicated in the parameter.  If the
  1798.                 parameter is "" the the screen capture is saved to the
  1799.                 default file name.  Snapshot always appends data to the
  1800.                 output file.  Returns zero on success or an error code
  1801.                 on failure.
  1802.  
  1803.     SPRINTF(string, ... )
  1804.         Returns: STRING
  1805.         Notes:  SPRINTF receives a format string in its first
  1806.                 argument followed by up to 10 additional arguments
  1807.                 that may be either integers or strings. The arguments
  1808.                 are formatted into a string according to rules
  1809.                 specified by embedded commands in the format string.
  1810.                 With the exception of floating point handling and
  1811.                 pointer notation, all of the functionality of the "C"
  1812.                 functions "printf" and "sprintf" are supported by
  1813.                 TE/2's implementation of SPRINTF, the reader is
  1814.                 referred to the C Language library reference manual of
  1815.                 his or her choice for complete definition of all of
  1816.                 the rules regarding format strings.  Here we will note
  1817.                 the following:
  1818.  
  1819.                   All characters from the format string are copied
  1820.                   to the output string with the following exceptions:
  1821.  
  1822.                   If "%s" is encountered in the format string, the
  1823.                   next unexamined parameter is interpreted as a
  1824.                   string an embedded at that point in the output
  1825.                   string.  The notation "%10s" will right justify the
  1826.                   string in a field of 10 spaces at that point in the
  1827.                   output string. "10" is used by way of example, it
  1828.                   may be any decimal number.  The notation "%-10s"
  1829.                   will likewise left justify the string in a field
  1830.                   of 10 spaces.
  1831.  
  1832.                   If "%d" is encountered in the format string, the
  1833.                   next unexamined parameter is interpreted as a
  1834.                   16 bit signed integer and the ascii representation
  1835.                   of it is embedded into the output string at that
  1836.                   point.  "%ld" interprets the numeric parameter as
  1837.                   a 32-bit signed integer (the native form of all
  1838.                   integers in the TE/2 script language).  "%10d" or
  1839.                   "%10ld" right justifies the number in a field of
  1840.                   10 spaces in the output string, "%010d" or "%010ld"
  1841.                   right justify the number in a field of ten zeros
  1842.                   in the output string.
  1843.  
  1844.                   If "%*s", "%-*s", "%*d", et cetera are encountered
  1845.                   in the format string, these will behave exactly the
  1846.                   same as the examples above with numeric values
  1847.                   except that TWO parameters are expected in the
  1848.                   argument list, the first an integer which will
  1849.                   specify the field width, the second the string or
  1850.                   integer to place in the output string.
  1851.  
  1852.                   If "%%" is encountered in the format string, a
  1853.                   single "%" is placed in the output string.
  1854.  
  1855.                 The arguments to SPRINTF may be literal strings,
  1856.                 string variables, string expressions, numeric
  1857.                 literals, constants, variables, or expressions
  1858.                 in any form or order.  The only restriction is that
  1859.                 the first argument, the format string, must evaluate
  1860.                 to a string.
  1861.  
  1862.                 WARNING
  1863.                 It is not possible to type check all of the
  1864.                 parameters in an SPRINTF (or MESSAGE or TRANSMIT)
  1865.                 argument list.  The script file writer is expected
  1866.                 to take precautions to avoid type mismatches so that
  1867.                 integers are not interpreted as strings and vice
  1868.                 versa.  In general, if a string is interpreted as an
  1869.                 integer there should be no ill effects other than
  1870.                 erroneous output.  If an integer is interpreted as
  1871.                 a string however, a protection violation may well
  1872.                 occur.
  1873.  
  1874.         Examples:
  1875.                 SPRINTF("Hello %s", "World")
  1876.                   returns "Hello World"
  1877.  
  1878.                 SPRINTF("Hello %8s", "world")
  1879.                   returns "Hello    world"
  1880.  
  1881.                 SPRINTF("Hello %-8s", "World")
  1882.                   returns "Hello World   "
  1883.  
  1884.                 SPRINTF("This is the %dth example", 4)
  1885.                   returns "This is the 4th example"
  1886.  
  1887.                 SPRINTF("Action is %03d%% %s", 35, "complete")
  1888.                   returns "Action is 035% complete"
  1889.  
  1890.  
  1891.  
  1892.     STATUS(void)
  1893.         Returns: INTEGER, always FALSE
  1894.         Notes:  This is equivalent to typing Alt-I from terminal mode.
  1895.  
  1896.  
  1897.     STREVAL(string)
  1898.         Returns: STRING, the value of its argument
  1899.         Notes:  This function is included as a convenience for the
  1900.                 REXX language script writer, it simply returns the
  1901.                 value of its argument allowing a REXX script to query
  1902.                 any TE/2 internal or global variable.
  1903.  
  1904.     STRCMP(string, string)
  1905.         Returns: INTEGER
  1906.         Notes:  Lexigraphically compares two strings, returns zero if
  1907.                 the strings are identical, less than zero if the
  1908.                 first string is "less than" the second, greater than
  1909.                 zero otherwise.
  1910.  
  1911.  
  1912.     STRGET(string, integer, integer, integer, integer, integer, integer)
  1913.         Returns: STRING, user response
  1914.         Notes:  String input routine.  The string parameter is the
  1915.                 default value, and the integer parameters are, in
  1916.                 order, row for the input, column for the input, width
  1917.                 of the input area, maximum input length (may be larger,
  1918.                 smaller or equal to the previous parameter), attribute
  1919.                 for 'first display' of the default, and attribute for
  1920.                 display while the user is editing/inputting.  Returns
  1921.                 the edited string, returns the empty string if the user
  1922.                 pressed ESCape.
  1923.                 Note that input area is NOT saved and restored, it will
  1924.                 remain on screen after the input.
  1925.  
  1926.  
  1927.     STRICMP(string, string)
  1928.         Returns: INTEGER
  1929.         Notes:  Case-insensitive version of STRCMP.  See STRCMP.
  1930.  
  1931.  
  1932.     STRLEFT(string, integer)
  1933.         Returns: STRING
  1934.         Notes:  Returns the leftmost N characters in the string where
  1935.                 N is the number specified in the second argument.  If
  1936.                 N is greater than the length of the string, the
  1937.                 entire string is returned. (see STRRIGHT, SUBSTR)
  1938.  
  1939.  
  1940.     STRLEN(string)
  1941.         Returns: INTEGER, the length of the string
  1942.  
  1943.  
  1944.     STRPUT(integer, integer, integer, string, ... )
  1945.         Returns: INTEGER, length of displayed string
  1946.         Notes:  The integer parameters are, in order, screen row,
  1947.                 screen column, and attribute for display.  The
  1948.                 string is a format string (see SPRINTF) which may
  1949.                 be followed by up to ten additional arguments.
  1950.                 The resulting string is placed at the indicated
  1951.                 position on screen using the indicated attribute.
  1952.                 Return value is the length of the displayed string.
  1953.  
  1954.  
  1955.     STRRIGHT(string, integer)
  1956.         Returns: STRING
  1957.         Notes:  Returns the rightmost N characters in the string where
  1958.                 N is the number specified in the second argument.  If
  1959.                 N is greater than the length of the string, the
  1960.                 entire string is returned. (see STRLEFT, SUBSTR)
  1961.  
  1962.  
  1963.     STRSTR(string, string)
  1964.         Returns: INTEGER
  1965.         Notes:  Scans the string in the first argument for an
  1966.                 occurrence of the string in the second.  Returns zero
  1967.                 if the string was not found else it returns the
  1968.                 position of the second string in the first.
  1969.  
  1970.  
  1971.     STRTRIM(string)
  1972.         Returns: STRING
  1973.         Notes:  Returns a string which is a copy of the string in
  1974.                 its argument with all leading space, tab, carriage
  1975.                 return, and newline characters removed from the
  1976.                 beginning and end.  Embedded spaces, etc., are not
  1977.                 removed.
  1978.  
  1979.  
  1980.     SUBSTR(string, integer, integer)
  1981.         Returns: STRING
  1982.         Notes:  Returns a substring of the string in its argument.
  1983.                 If N is the value of the second argument and M the
  1984.                 value of the third, SUBSTR returns the string which
  1985.                 begins N characters into the first argument and
  1986.                 continues for M characters.  If N is greater than the
  1987.                 length of the string, the empty string is returned,
  1988.                 if N+M is greater than the length of the string, only
  1989.                 the characters in the string from position N to the
  1990.                 end of the string are returned. (see STRLEFT and
  1991.                 STRRIGHT)
  1992.  
  1993.  
  1994.     TERMECHO(special)
  1995.         Returns: INTEGER, TRUE or FALSE
  1996.         Notes:  The special argument must be one of TRUE, FALSE, or
  1997.                 TOGGLE.  TERMECHO will enable or disable the echoing
  1998.                 of characters to the terminal screen.  This effects
  1999.                 both incoming characters from the comm port received
  2000.                 during a WAITFOR, MUXWAIT, RGETS, or RGETC and
  2001.                 characters typed at the keyboard during a GETS call.
  2002.                 It does NOT have any effect on characters received
  2003.                 during a main or higher level PROCESS.
  2004.         Example:
  2005.                 message("Enter string to wait for:")
  2006.                 termecho(FALSE)
  2007.                 waitSrch = gets(255)  ; no screen echo here
  2008.                 waitfor(waitSrch, 60) ; or here
  2009.                 process               ; screen will update during this
  2010.                                       ; but will still be off when we
  2011.                                       ; get back
  2012.  
  2013.  
  2014.     TOLOWER(string)
  2015.         Returns: STRING
  2016.         Notes:  Returns a string which is a copy of its argument
  2017.                 with all upper case letters translated to lower case.
  2018.                 (see TOUPPER)
  2019.  
  2020.  
  2021.     TOUPPER(string)
  2022.         Returns: STRING
  2023.         Notes:  Returns a string which is a copy of its argument
  2024.                 with all lower case letters translated to upper case.
  2025.                 (see TOLOWER)
  2026.  
  2027.  
  2028.     TRACE(integer)
  2029.         Returns: INTEGER, the value of its argument
  2030.         Notes:  Enables and disables trace mode during script file
  2031.                 execution.  When in trace mode each line of the
  2032.                 script file is printed on the terminal display (and
  2033.                 will appear in the scroll back buffer and log file
  2034.                 if one is open) as it is encountered.  This is a
  2035.                 global toggle, once turned on it is on for all
  2036.                 subsequent script file processing until it is turned
  2037.                 off again or until TE/2 ends.
  2038.  
  2039.  
  2040.     TRANSMIT(string, ... )
  2041.         Returns: INTEGER, the length of the message string
  2042.         Notes:  TRANSMIT takes a parameter list identical to the
  2043.                 SPRINTF function, refer to SPRINTF for a more
  2044.                 complete discussion of the format string and its
  2045.                 arguments.  This function will build a string
  2046.                 according to the rules for SPRINTF and transmit
  2047.                 it to the comm port.
  2048.  
  2049.  
  2050.     UPLOAD(special, string)
  2051.         Returns: INTEGER, TRUE or FALSE
  2052.         Notes:  The "special" parameter must be one of the following
  2053.                 pre-defined constants: ASCII, XMODEM, XMODEM1K,
  2054.                 YMODEM, YMODEMG, ZMODEM, or QUERY.  If this parameter
  2055.                 is QUERY, the user is prompted for the protocol.  The
  2056.                 second parameter is the file name, if it is the empty
  2057.                 string, the user is prompted for the file name.
  2058.                 The function returns TRUE if the file transfer ended
  2059.                 with no fatal errors.  (See DOWNLOAD)
  2060.  
  2061.  
  2062.     WAITFOR(string, integer)
  2063.         Returns: INTEGER, TRUE or FALSE
  2064.         Notes:  Does not return until either the string specified in
  2065.                 the first parameter is encountered at the comm port,
  2066.                 the duration in seconds specified in the second
  2067.                 parameter has elapsed, or the user types ESCape,
  2068.                 whichever occurs first.  Returns TRUE if the string
  2069.                 was encountered, FALSE if a timeout occurred or the
  2070.                 wait was aborted by typing ESCape.
  2071.                 Note that specifying a number less than zero as the
  2072.                 timeout parameter, timeout processing is disabled.
  2073.                 Incoming characters are echoed to the terminal screen
  2074.                 unless terminal display is turned off, the log file
  2075.                 is maintained.  (See MUXWAIT, WATCHFOR)
  2076.  
  2077.  
  2078.     WATCHFOR(string, string)
  2079.         Returns: INTEGER, 'handle' for installed watch
  2080.         Notes:  Unlike WAITFOR, which does not return until the
  2081.                 indicated string has been encountered or a set period
  2082.                 of time has elapsed, WATCHFOR installs an asynchronous
  2083.                 'watch' and returns immediately.  The return value is
  2084.                 zero if TE/2 could not install this watch, only 10
  2085.                 watches may be active at any time.  If successful,
  2086.                 the return value is a 'handle' which you will
  2087.                 need to pass to CANCELWATCH when you want to end
  2088.                 the watch.  This handle is therefore every bit as
  2089.                 precious as the handle returned from FOPEN and the
  2090.                 warnings given below in the notes about file handles
  2091.                 apply equally well to watch handles.
  2092.                 The first parameter is the string to 'watch' for.
  2093.                 The second parameter may be nearly any valid TE/2
  2094.                 Script Language assignment statement or function
  2095.                 call.  The statement is not checked for proper syntax
  2096.                 or variable usage until the watch string has been
  2097.                 matched and TE/2 attempts to execute the statement so
  2098.                 you must take care that the syntax is correct and
  2099.                 that any variables referred to in the statement will
  2100.                 be accessible when the statement is to be executed.
  2101.                 Global and system-global variables are always safe
  2102.                 but local variables will cause problems if the watch
  2103.                 is left to continue after the current script has
  2104.                 finished execution or during the execution of any
  2105.                 nested script files or recursive PROCESSes.
  2106.                 Every incoming character from the com port is checked
  2107.                 against the currently active watches, if a watch
  2108.                 string is matched it is tagged for execution.  If
  2109.                 TE/2 is in a process loop at the time, it will be
  2110.                 immediately executed.  However, if a script file
  2111.                 is running at the time, it will not execute until
  2112.                 the current line has finished execution - this means
  2113.                 that a WAITFOR, MUXWAIT, RGETS, RGETC, etc., will not
  2114.                 be interrupted to execute a watch command.
  2115.                 Use the function CANCELWATCH to release a watch that
  2116.                 is no longer needed. (See CANCELWATCH)
  2117.         Example:
  2118.  
  2119.                 integer whand1
  2120.                 integer whand2
  2121.                 integer gotMail = FALSE
  2122.  
  2123.                 program
  2124.                   whand1 = watchfor("ENTER to continue", "sendbyte(13)")
  2125.                   whand2 = watchfor("mail waiting", "gotMail = TRUE")
  2126.                   waitfor("Enter your choice:", 120)
  2127.                   cancelwatch(whand1)
  2128.                   cancelwatch(whand2)
  2129.                   if gotMail
  2130.                     ; et cetera
  2131.  
  2132.  
  2133.  
  2134. Special Notes on the File Handling Functions:
  2135. =============================================
  2136.  
  2137.   The integer value returned from FOPEN is a very important one.  It
  2138. is a file "handle" that is used for all actions performed on that
  2139. file via the other file oriented functions.  This value should NOT be
  2140. modified by your program until the file is safely closed (via a call
  2141. to FCLOSE) and is no longer needed.  Though all the other file
  2142. oriented functions other than FOPEN will accept any integer valued
  2143. expression in the field used for the file handle, it is VERY
  2144. dangerous to use anything but the variable containing the value
  2145. returned from FOPEN.  Any number of problems, up to and including
  2146. general protection violations, may occur is this procedure is not
  2147. followed.
  2148.  
  2149.   The valid open modes for a file that may be used as the second
  2150. argument to FOPEN are given in Table 6 below.  Certain of the file
  2151. oriented functions will operate only on a file which has been opened
  2152. in a mode which permits reading from the file.  FGETS, FGETC, are
  2153. examples of these functions.  Others, like FPUTS and FPUTC, will
  2154. operate only on a file which has been opened on a file which has been
  2155. opened in a mod which allows writing to the file.  Others, like
  2156. FCLOSE and FTELL will work on any open file.
  2157.  
  2158.  
  2159.         Table 6. -- Valid "mode" parameters for FOPEN
  2160.         ---------------------------------------------
  2161.  
  2162.           "r"   open for reading. If the file does not exist,
  2163.                 the FOPEN call will fail.
  2164.  
  2165.           "w"   open an empty file for writing.  If the given
  2166.                 file exists it will be truncated.
  2167.  
  2168.           "a"   open for writing at the end of file (appending)
  2169.                 create the file if it does not exist.
  2170.  
  2171.           "r+"  open for both reading and writing.  If the file
  2172.                 does not exist, the FOPEN call will fail.
  2173.  
  2174.           "w+"  open for both reading and writing.  If the given
  2175.                 file exists it will be truncated.
  2176.  
  2177.           "a+"  open for both reading and appending.  If the file
  2178.                 does not exist it will be created.
  2179.  
  2180.  
  2181.           Translation mode specifiers:
  2182.           ---------------------------
  2183.           One of the following characters may be optionally appended
  2184.           to the mode string, they control the translation mode of
  2185.           the file.  The default mode is "t" (translated) mode so
  2186.           that the use of "t" is unnecessary.
  2187.  
  2188.             "b"   open in binary (untranslated) mode.  Absolutely
  2189.                   no translation is performed on data read from or
  2190.                   written to the file.
  2191.  
  2192.             "t"   open in text (translated) mode.  Carriage return-
  2193.                   line feed combinations are translated to a single
  2194.                   line feed on input, line feed characters are
  2195.                   translated to carriage return-line feed pairs on
  2196.                   output.  Control-Z characters are considered to
  2197.                   be the end of file regardless of their position
  2198.                   in the physical file.  A file opened for writing
  2199.                   or read/writing will have a Control-Z found at the
  2200.                   end of the file removed if possible because the
  2201.                   presence of this character at the end of the file
  2202.                   may cause FSEEK to behave improperly.
  2203.                   Note that the return value of FTELL and the actions
  2204.                   of FSEEK may not be consistent with the actual
  2205.                   physical locations in a file opened in translated
  2206.                   mode.  However, they will behave compatibly, that
  2207.                   is,  FSEEKing to a location previously determined
  2208.                   by a call to FTELL will return the location pointer
  2209.                   to the same spot in the file.
  2210.  
  2211.                   Note: because "t" is the default action for FOPEN,
  2212.                   its use is discouraged.
  2213.  
  2214.  
  2215.  
  2216. Special Notes on Julian Date Conversion Functions:
  2217. ==================================================
  2218.  
  2219.   General notes on the calendars:
  2220.   -------------------------------
  2221.  
  2222.   Julian proleptic dates earlier than January 1, 4713 B.C. are
  2223. invalid, as are Julian dates in the year 0.  Gregorian dates prior to
  2224. October 15, 1582 are also invalid, as are dates with month numbers
  2225. not in the range 1 to 12, or with day numbers less than 1 or greater
  2226. than the number of days in that month.  Invalid dates will cause an
  2227. error return.
  2228.  
  2229.  
  2230.   Julian Date Conversion Functions:
  2231.   ---------------------------------
  2232.  
  2233.   JULIAN(integer packed_date, integer Gregorian)
  2234.   JULIAN2(integer mon, integer day, integer year, integer Gregorian)
  2235.  
  2236.   These two functions return the Julian Day Number corresponding to
  2237. the input calendar date or -1 if given an invalid input date.  If
  2238. parameter 'Gregorian' is non-zero, this denotes input as a Gregorian
  2239. calendar date, otherwise it is a Julian calendar date.  Note that, in
  2240. JULIAN, the date is given in the same packed format as the TE/2
  2241. Script Language read-only variable 'date', in JULIAN2 the date is
  2242. broken out into its componants.  Month ranges from 1 to 12, day from
  2243. 1 to 31 (or less depending on the month).  For Julian B.C. dates,
  2244. express the year as a negative number (remembering, there is no
  2245. Julian Year 0).  These function are, except as noted above,
  2246. identical.
  2247.  
  2248.  
  2249.   JDATE(integer JulianDay, integer Gregorian)
  2250.  
  2251.   Returns date, in packed format, if it can calculate it from the
  2252. Julian Day Number argument (JulianDay), or 0 if it cannot.  If valid,
  2253. the calculated month, day, and year are stored in the return value in
  2254. the same packed format as the TE/2 Script Language read-only variable
  2255. 'date'.  If parameter 'Gregorian' is non-zero, a Gregorian calendar
  2256. date will be calculated, otherwise a Julian calendar date is
  2257. calculated.
  2258.  
  2259.  
  2260.   JWDAY(integer JulianDay)
  2261.  
  2262.   Returns a day-of-week code (0 => Sunday, 1 => Monday, etc.) if
  2263. given a valid Julian Day Number, or -1 if the Julian Day Number is
  2264. invalid.
  2265.  
  2266.  
  2267.  
  2268. Notes on REXX Scripts
  2269. =====================
  2270.  
  2271.   You can call a REXX script from TE/2 anyplace you can call a TE/2
  2272. Script Language script!  TE/2 determines whether or not it's a REXX
  2273. script by examining the first two bytes of the file for "/*" (as all
  2274. good REXX files should begin) so you can name the file with a .SCR
  2275. if you want.  If it's not .SCR, you'll have to specify the full file
  2276. name.  REXX scripts also go into a directory referred to in the
  2277. ScriptPath .INI variable (see note below).
  2278.  
  2279.   A REXX script is executed directly (not via a shell to the command
  2280. processor) and the default addressing environment is set to 'TE2'.
  2281. As a subcommand handler, TE2 will accept any command that can be
  2282. typed at the Alt-/ Command Prompt (i.e, any TE/2 Script Language
  2283. assignment or function but not "if", "do .. loop" or any such control
  2284. construct).
  2285.  
  2286.   TE2 also registers itself to handle screen and keyboard i/o.  All
  2287. PULLs come from TE/2's keyboard handler and all, non debug, SAYs go
  2288. to TE/2 terminal screen.  Debug mode SAYs go to stderr as always.
  2289.  
  2290.  
  2291.   Calling a TE/2 Script language function from REXX:
  2292.   --------------------------------------------------
  2293.  
  2294.   Just put the call into quotes like you would if you were addressing
  2295.   CMD.EXE, the return value will be in RC.  E.g.,
  2296.  
  2297.      'upload(ZMODEM, "myfile.zip")'
  2298.      if rc = 1 ...
  2299.  
  2300.   Note the use of single and double quotes.  REXX will accept either but
  2301.   the TE/2 Script Language requires double quotes to delimit it's strings
  2302.   so you will have to watch for this.
  2303.  
  2304.   If you wanted to make the above UPLOAD call but had the file name in
  2305.   a REXX variable, call it as such:
  2306.  
  2307.      'upload(ZMODEM, "' rexxvar '")'
  2308.  
  2309.   If the TE/2 Script function returns a string instead of a numeric
  2310.   value, this also will be in rc.  E.g.,
  2311.  
  2312.      'rgets(250, 60, TRUE)'
  2313.      if rc = 'exit' ...
  2314.  
  2315.  
  2316.  
  2317.   Errors when calling TE/2:
  2318.   -------------------------
  2319.  
  2320.   After returning from calling a TE/2 Script Language function, the
  2321. REXX special variable RC is always set to the return value of the
  2322. function unless a syntax error of some sort occured.  TE/2 will print
  2323. an error message on the terminal screen in this event and raise a REXX
  2324. error condition (the value of RC is indetermanent in this case).  You
  2325. may want to use the REXX "SIGNAL ON ERROR ..." feature while debugging
  2326. scripts.
  2327.  
  2328.  
  2329.  
  2330.   Querying TE/2 Internal 'System' Variables:
  2331.   ------------------------------------------
  2332.  
  2333.   Clearly, because you aren't executing a TE/2 script language script,
  2334. you won't have any TE/2 local, user variables to deal with at all but
  2335. you may want to query a TE/2 system variable or perhaps a global variable
  2336. from a previously executed TE/2 Script Language script.
  2337.  
  2338.   If the variable is a string:  use the StrEval() function.
  2339.      'streval(downloadpath)'
  2340.      rxdlpath = rc
  2341.  
  2342.   If the variable is an integer: use the itoa() function.
  2343.      'itoa(kbdabort, 10)'
  2344.      if rc = 1 ...
  2345.  
  2346.  
  2347.  
  2348.   Setting a TE/2 Variable from REXX:
  2349.   ----------------------------------
  2350.  
  2351.   Some TE/2 System variables may be set by a script, all global user
  2352. variables may also be set.
  2353.  
  2354.   Set a string from a literal:
  2355.      'downloadpath = "D:\Junk"'
  2356.        -- or --
  2357.      'downloadpath = "' "D:\Junk" '"'
  2358.  
  2359.   Set a string from a variable:
  2360.      'downloadpath = "' rxvar '"'
  2361.  
  2362.   Set an integer from a literal:
  2363.      'localecho = 1'
  2364.         -- or --
  2365.      'localecho = ' 1
  2366.  
  2367.   Set an integer from a variable:
  2368.      'localecho = ' rxnumvar
  2369.  
  2370.  
  2371.